Skip to main content

mobileCreateLocalNotification

Type

command

Summary

Schedules a new Local Notification with the operating system.

Syntax

mobileCreateLocalNotification <alertBody>, <alertButtonMessage>, <alertPayload>, <alertTime>, <playSound> [, <badgeValue>]

Description

Use the mobileCreateLocalNotification command to schedule a Local Notification with the operating system from within a stack on iOS or Android.

This command schedules Local Notifications with the iOS or Android operating sytem and delivers the alertPayload to the application. The alertPayload is delivered using the localNotificationReceived message.

Parameters

NameTypeDescription

alertBody

The text that is to be displayed on the notification dialog that is raised when the application is not running.

alertButtonMessage

The button text on the notification dialog that is to appear on the button that launches the application, when the application is not running.

alertPayload

A text payload that can be sent with the notification request. This payload is presented to the user via the localNotificationReceived message.

alertTime

The time at which the alert is to be sent to the application. This parameter needs to be set in seconds and is the number of seconds since the UNIX Epoch, at which the notification should be triggered.

playSound

boolean

A boolean to indicate if a sound is to be played when the alert is received.

badgeValue

The number value to which the badge of the application logo is to be set. 0 hides the badge. >0 displays the value on the badge.

Examples

mobileCreateLocalNotification "The Alert Body", "Show Me", "It is time to do some Exercise", the seconds + 10, true, "1"

command: mobileCancelAllLocalNotifications, mobileCancelLocalNotification

function: result

glossary: command

message: localNotificationReceived

object: stack

Compatibility and Support

Introduced

LiveCode 5.5

OS

ios

android

Platforms

mobile

Thank you for your feedback!

Was this page helpful?